# coding: utf-8

from celery import shared_task
from services.datamodel.sms.models import mm_SmsTemplate
from services.datamodel.share import stats_logger
from services.datamodel.student.models import mm_StudentFans


# 群发短信
@shared_task(ignore_result=True)
def send_sms_to_user(difference_id, intention, t_id, headmaster_id, launch_id, launch_dynamic_id, is_wechat, group):

    stats_logger.debug("send_sms_to_user")
    mm_SmsTemplate.sending(t_id, intention=intention, difference_id=difference_id, headmaster_id=headmaster_id,
                           launch_id=launch_id, launch_dynamic_id=launch_dynamic_id, is_wechat=is_wechat, group=group)

@shared_task(ignore_result=True)
def set_browse(user_id, business, channel):
    mm_StudentFans.set_record(user_id, business, channel)
